
const ElectronServer = require('./electron-server')

// electron:serve
module.exports = class {
  constructor(api, opts) {
    return async function(args, rawArgs) {
      process.env.IS_ELECTRON = true;
      /* 启动渲染进程服务 */
      let server = await api.service.run(
        "serve",
        args,
        rawArgs
      );
      process.env.WEBPACK_DEV_SERVER_URL = server.url;

      /* 启动 electron 进程 */
      new ElectronServer(api, opts)
    }
  }
}

